// import { createBrowserRouter } from "react-router-dom"
// import Login from "../pages/login"
// import Home from "../pages/home"
// import Article from "../pages/article"
// import Publish from "../pages/publish"
// import { Navigate } from "react-router-dom"
// import PrivateRoute from "../components/PrivateRoute" // 引入PrivateRoute组件

// const router = createBrowserRouter([
//   {
//     path: "/login",
//     element: <Login></Login>,
//   },
//   {
//     path: "/",
//     element: <PrivateRoute><Navigate to="/home" /></PrivateRoute>,
//   },
//   {
//     path: "/home",
//     element: <PrivateRoute><Home></Home></PrivateRoute>,
//     children: [
//       {
//         index: true,
//         element: <PrivateRoute><Article></Article></PrivateRoute>,
//       },
//       {
//         path: "/home/publish",
//         element: <PrivateRoute><Publish></Publish></PrivateRoute>,
//       },
//     ],
//   },
// ])

// export default router
